//
//  WJTransitionDelegate.swift
//  PDFSign
//
//  Created by 李永彬 on 2025/9/28.
//

import UIKit

class WJTransitionDelegate: NSObject, UIViewControllerTransitioningDelegate {
    
    // 单例模式，便于复用
    static let shared = WJTransitionDelegate()
    
    private override init() {
        super.init()
    }
    
    // MARK: - UIViewControllerTransitioningDelegate
    
    func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return WJScaleFadeAnimator(isPresenting: true)
    }
    
    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        return WJScaleFadeAnimator(isPresenting: false)
    }
    
    func presentationController(forPresented presented: UIViewController, presenting: UIViewController?, source: UIViewController) -> UIPresentationController? {
        return WJPresentationController(presentedViewController: presented, presenting: presenting)
    }
}
